package com.github.aloxc.plugin.restplus.annotations;

import com.github.aloxc.plugin.DonotGuard;


/**
 *
 * @author leero
 */
public enum MicronautRequestAnnotation {

    /**
     * CONTROLLER
     */
    @DonotGuard
    CONTROLLER("Controller", "io.micronaut.http.annotation.Controller",null);

    MicronautRequestAnnotation(String shortName, String qualifiedName, String methodName) {
        this.shortName = shortName;
        this.qualifiedName = qualifiedName;
        this.methodName = methodName;
    }

    private String shortName;
    private String qualifiedName;
    private String methodName;

   public String methodName() {
        return this.methodName;
    }

    public String getQualifiedName() {
        return qualifiedName;
    }

    public String getShortName() {
        return shortName;
    }

    public static MicronautRequestAnnotation getByShortName(String shortName) {
        for (MicronautRequestAnnotation requestAnnotation : MicronautRequestAnnotation.values()) {
            if (requestAnnotation.getShortName().equals(shortName)) {
                return requestAnnotation;
            }
        }
        return null;
    }

    public static MicronautRequestAnnotation getByQualifiedName(String qualifiedName) {
        for (MicronautRequestAnnotation requestAnnotation : MicronautRequestAnnotation.values()) {
            if (requestAnnotation.getQualifiedName().equals(qualifiedName)) {
                return requestAnnotation;
            }
        }
       return null;
    }

}